import cv2 as cv
import sys
import os
from python_ai.common.xcommon import *

img_path = '../../../../large_data/pic/dog_bird.jpg'
file_name = os.path.basename(__file__)
img_path_tmp = get_tmp_file_name(img_path, 'png', file_name + '.d')

img = cv.imread(img_path)
if img is None:
    sys.exit("Could not read img: " + img_path)

cv.imshow("x1_start_with_img.py", img)

print('Image showed. Press s to save it as png format.')
k = cv.waitKey(0)

if k == ord('s'):
    cv.imwrite(img_path_tmp, img)
